package com.ocom.xcxapi.client;

import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.constant.WxServiceUrl;
import com.ocom.common.entity.human.EntityRoommateInfo;
import com.ocom.common.entity.master.EntityWechatPerInfo;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.PersonVo;
import com.ocom.common.vo.human.GetPersoDecryVo;
import com.ocom.common.vo.human.UserInfoVo;
import com.ocom.xcxapi.vo.fangke.UpdateVisitorRecordVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "human")
public interface HumanClientService {

//

    /**
     * 添加微信用户
     * @param wechatPerInfo
     */
    @PostMapping(HumanServiceUrl.URLP_HUAMN_ADD_WXPER)
    Result addWxper(@RequestBody EntityWechatPerInfo wechatPerInfo);

    /**
     * 获取人员列表personnel/getPersonInfo
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody Map<String,Object> map);

    /**
     * 获取人员列表personnel/getPersonInfo
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody UserInfoVo userInfoVo);


    /**
     * 获取人员信息 getPersonInfo
     * */
    @GetMapping(HumanServiceUrl.URL_GetPersonInfo)
    public Result GetPersonInfo(@RequestParam("comId") Long comId,@RequestParam("pId") Long pId);

    /**
     * 根据手机号身份证获取人员信息 getPersonInfoByPhoneOrCard
     * */
    @PostMapping(HumanServiceUrl.URL_GetPersonInfoByPhoneOrCard)
    public Result  GetPersonInfoByPhoneOrCard(@RequestBody Map<String,Object> map);

    /**
     * 获取审批记录列表  (getVisitorRecord)
     * */
    @PostMapping(HumanServiceUrl.URL_GetVisitorRecord)
    public Result GetVisitorRecord(@RequestBody Map<String,Object> map);


    /**
     * 邀请人发起访客申请单  (addVisitorRecord)
     * */
    @PostMapping(HumanServiceUrl.URL_AddVisitorRecord)
    public Result AddVisitorRecord(@RequestBody Map<String,Object> map);

    /**
     * 删除访客申请记录（deleteVisitorRecord）
     * */
    @PostMapping(HumanServiceUrl.URL_DeleteVisitorRecord)
    public Result DeleteVisitorRecord(@RequestBody Map<String,Object> map);


    /**
     * 审批访客申请记录  (updateVisitorRecord)
     * */
    @PostMapping(HumanServiceUrl.URL_UpdateVisitorRecord)
    public Result UpdateVisitorRecord(@RequestBody UpdateVisitorRecordVo updateVisitorRecordVo);



    /**
     * 访客详情页面 (detailVisitorInfo)
     * */
    @GetMapping(HumanServiceUrl.URL_DetailVisitorInfo)
    public Result DetailVisitorInfo(@RequestParam("comId")Long comId,@RequestParam("recodeId")Long recodeId);


    /**
     * 获取审批负责人列表  (getVisitorApprover)
     * */
    @PostMapping(HumanServiceUrl.URL_GetVisitorApprover)
    public Result GetVisitorApprover(@Validated @RequestBody Map<String,Object> map);


    /**
     * 补充访客信息  (addVisitorInfo)
     * */
    @PostMapping(HumanServiceUrl.URL_AddVisitorInfo)
    public Result AddVisitorInfo(@Validated @RequestBody Map<String,Object> map);

    /**
     * 获取微信人员(getWxPerson)
     * */
    @GetMapping(HumanServiceUrl.URL_GetWxPerson)
    public Result GetWxPerson(@RequestParam("appId")String appId,@RequestParam("openId")String openId);

    /**
     * 删除微信绑定人员(delWxPerson)
     * */
    @PostMapping(HumanServiceUrl.URL_DelWxPerson)
    public Result DelWxPerson(@RequestParam("appId")String appId,@RequestParam("openId")String openId);

//
//    @PostMapping(HumanServiceUrl.URLP_addEcardRegCode)
//    Result addEcardRegCode(@RequestParam("companyId")Long companyId,@RequestParam("pId") Long pId,@RequestParam("regCode") String regCode,@RequestParam("endTime") Date endTime);


    //消费的用户信息
    @PostMapping(HumanServiceUrl.URL_getXfUserInfo)
    public Result getXfUserInfo(@RequestParam("comId")Long comId,@RequestParam("pId")Long pId);

    @PostMapping(WxServiceUrl.URL_modifyPhoto)
    public Result modifyPhoto(@RequestBody PersonVo personVo);

    /**
     * 根据手机号身份证获取人员信息 getPersonInfoByPhoneOrCard
     * */
    @PostMapping(HumanServiceUrl.URL_GetPersonInfoByPhoneOrCard)
    public Result  GetPersonInfoByPhoneOrCard(@RequestBody GetPersoDecryVo getPersoDecryVo);


    /**修改人员信息*/
    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePerson)
    public Result UpdatePerson(@RequestBody PersonVo personVo);


    @PostMapping(HumanServiceUrl.URL_AddRoommate)
    public Result AddRoommate(@Validated @RequestBody EntityRoommateInfo entityRoommateInfo);

}
